package com.abetsy.vben;

import java.net.InetAddress;
import java.util.HashMap;
import java.util.Map;

public class UrlDoMain {

    public static void main(String[] args) {
        Map<String, String> hostEnv = new HashMap<>();
        String domain = "skiree.host";
        try {
            InetAddress[] addresses = InetAddress.getAllByName(domain);
            for (InetAddress address : addresses) {
                if (address.isReachable(2000)) {
                    if (address.getAddress().length == 4) {
                        hostEnv.put("IPV4", address.getHostAddress());
                    } else if (address.getAddress().length == 16) {
                        hostEnv.put("IPV6", address.getHostAddress());
                    }
                }
            }
        } catch (Exception ignored) {}
        System.out.println(hostEnv);
    }
}
